﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace MtC.Tools.QuadtreeCollider.Test
{
    /// <summary>
    /// 当发生碰撞时禁用碰撞器的组件，用于测试延迟禁用碰撞器的功能
    /// </summary>
    [RequireComponent(typeof(CircleQuadtreeCollider))]
    public class DisableColliderOnCollisionEnter : MonoBehaviour, IOnQuadtreeCollisionEnter
    {
        public void OnQuadtreeCollisionEnter(QuadtreeCollider collider)
        {
            GetComponent<CircleQuadtreeCollider>().enabled = false;

            Debug.Log(gameObject.name + " 禁用碰撞器");
        }
    }
}
